#include <cstdio>

#define RECURSION_LIMIT 101

typedef unsigned int uint;


uint f[RECURSION_LIMIT];


uint f91 (uint n)
{
	if (n >= RECURSION_LIMIT)
		return n - 10;

	uint &r = f[n];
	if (r)
		return r;

	r = f91(f91(n+11));
	return r;
}


int main ()
{
	uint n;
	while (scanf("%u", &n), n)
	{
		printf("f91(%u) = %u\n", n, f91(n));
	}
}